//
//  MessageCell.m
//  LiveStar
//
//  Created by 漪珊 on 2016/12/14.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "MessageCell.h"
#import "CommentNoticeModel.h"
#import "PraviteRecieveModel.h"

@implementation MessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    kImageViewRadius(self.MsgsenderIcon, self.MsgsenderIcon.width/2);
    kViewRadius(self.MessageState, self.MessageState.width/2);
    self.MessageState.backgroundColor = [UIColor redColor];
}
- (void)layoutSubviews {
    self.MessageState.backgroundColor = [UIColor redColor];
}

- (void)setCommentnoticeModel:(CommentNoticeModel *)commentnoticeModel {
    _commentnoticeModel = commentnoticeModel;
    [self.MsgsenderIcon sd_setImageWithURL:[NSURL URLWithString:commentnoticeModel.u_avatar] placeholderImage:kPlACE_ICON];
    self.msgTitle.text = commentnoticeModel.u_nickname;
    self.messageDetailLabel.text = commentnoticeModel.c_content;
    if ([commentnoticeModel.c_status intValue] == 10) {
        self.MessageState.hidden = NO;
    } else {
        self.MessageState.hidden = YES;
    }
}

- (void)setPraviteModel:(PraviteRecieveModel *)praviteModel {
    _praviteModel = praviteModel;
    [self.MsgsenderIcon sd_setImageWithURL:[NSURL URLWithString:praviteModel.cavatar] placeholderImage:kPlACE_ICON];
    self.msgTitle.text = praviteModel.cnickname;
    self.messageDetailLabel.text = praviteModel.c_content;
    if ([praviteModel.c_status intValue] == 10) {
        self.MessageState.hidden = NO;
    } else {
        self.MessageState.hidden = YES;
    }
}
@end
